#include "hplcqinfinesendcommonsystempacket.h"
#include "hplcqinfineprotocolcommondata.h"
#include "hplcqinfinepfcid.h"

namespace hplc
{
namespace qinfine
{

HplcQinfineSendCommonSystemPacket::HplcQinfineSendCommonSystemPacket(HplcQinfineProtocolCommonData &data)
{
    m_d = &data;
}

void HplcQinfineSendCommonSystemPacket::setReset()
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_RESET);
    m_d->m_checker->sendNoRetry();
}

void HplcQinfineSendCommonSystemPacket::setRestoreDefault(quint8 flag)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_RESTORE_DEFAULT, flag);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setSaveAsDefault()
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_SAVE_AS_DEFAULT);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setSuperPassword(char *str)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_SUPERPASSWORD, str);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getSuperPassword()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_SUPERPASSWORD);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getSoftwareVersion()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_SOFTWARE_VERSION);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getHardwareVersion()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_HARDWARE_VERSION);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setProductDate(char *str)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_PRODUCT_DATE, str);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getProductDate()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_PRODUCT_DATE);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setSerialNumber(char *str)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_SERIAL_NUMBER, str);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getSerialNumber()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_SERIAL_NUMBER);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setModel(quint8 model)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_MODEL, model);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getModel()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_MODEL);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setModelString(char *str)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_MODEL_STRING, str);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getModelString()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_MODEL_STRING);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setUsedTime(quint32 time)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_USED_TIME, time);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getUsedTime()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_USED_TIME);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getAllData()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_ALL_DATA);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setProtocol(quint8 protocol)
{
    m_d->m_maker->makePacket(SET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_PROTOCOL, protocol);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::getProtocol()
{
    m_d->m_maker->makePacket(GET_PFC(PFC_GLOBAL_EXT_SYSTEM), (quint8)PFC_GES_PROTOCOL);
    m_d->m_checker->sendRetry();
}

void HplcQinfineSendCommonSystemPacket::setRandomCode(quint32 randomCode)
{

}

void HplcQinfineSendCommonSystemPacket::getRandomCode()
{

}

void HplcQinfineSendCommonSystemPacket::setActiveCode(quint32 activeCode)
{

}

void HplcQinfineSendCommonSystemPacket::getActiveCode()
{

}

void HplcQinfineSendCommonSystemPacket::setUsefulDays(quint16 usefulDays)
{

}

void HplcQinfineSendCommonSystemPacket::getUsefulDays()
{

}

void HplcQinfineSendCommonSystemPacket::setPowerOnInfo(quint8 code, char *info)
{

}

} // qinfine
} // hplc

